import anotation.service.AnnotationMockService;
import javaconfig.service.JavaConfigMockService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import xml.service.XmlMockService;

public class Application {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-xml.xml");
        XmlMockService xmlMockService = context.getBean(XmlMockService.class);
        String s0 = xmlMockService.listIds();
        //print [1,2,3]
        System.out.println(s0);

        ApplicationContext annotationContext = new ClassPathXmlApplicationContext("spring-annotation.xml");
        AnnotationMockService annotationMockService = annotationContext.getBean(AnnotationMockService.class);
        String s1 = annotationMockService.listIds();
        //print [4,5,6]
        System.out.println(s1);

        ApplicationContext javaConfigContext = new ClassPathXmlApplicationContext("spring-javaconfig.xml");
        JavaConfigMockService javaConfigMockService = javaConfigContext.getBean(JavaConfigMockService.class);
        String s2 = javaConfigMockService.listIds();
        //print [7,8,9]
        System.out.println(s2);

    }

}
